package nsu.edu.zsq.controller.sys;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageInfo;

import nsu.edu.zsq.bean.SysLog;
import nsu.edu.zsq.common.JsonData;
import nsu.edu.zsq.param.PageQuery;
import nsu.edu.zsq.param.SysLogSearch;
import nsu.edu.zsq.service.sys.SysLogService;

/** 
* Description: 系统操作日志的controller<br>
*/
@Controller
@RequestMapping("/sys/log")
public class SysLogController {
    
    @Autowired
    private SysLogService sysLogSercice;
    
    @RequestMapping("/listSysLog")
    @ResponseBody
    public JsonData listSysLogWithPage(PageQuery pageQuery) {
        PageInfo<SysLog> listSysLog = sysLogSercice.listSysLogWithPage(pageQuery);
        return JsonData.success(listSysLog);
    }
    
    @RequestMapping("/listSysLogBySearch")
    @ResponseBody
    public JsonData listSysLogWithPageBySearch(SysLogSearch sysLogSearch, PageQuery pageQuery) {
        PageInfo<SysLog> listSysLog = sysLogSercice.listSysLogWithPageBySearch(sysLogSearch, pageQuery);
        return JsonData.success(listSysLog);
    }
}
